﻿@model AesApplication.Models.HiringSpecialistIndexViewModel

@using AesApplication.Models;

@{
    ViewBag.Title = "Index";
}

<h2>@User.Identity.Name Job List</h2>

@foreach (Department dept in Model.Departments.ToList())
{
    <h3>@dept.Store.Name - @dept.Name</h3>

    <ul>
        @if (dept.Jobs.Where(x => x.Status == JobStatus.Active).Count() > 0)
        {
            foreach (Job job in dept.Jobs.Where(x => x.Status == JobStatus.Active))
            {
                <li>
                    @Html.ActionLink(
                        String.Format("{0} - {1} application(s)", job.Title, job.Applications.Where(x => x.Status == ApplicationStatus.AwaitingHumanScreening).Count()),
                        "InterviewGrid",
                        new { id = job.ID })
                </li>
            }
        }
        else
        {
            <i>There are no job openings in this department.</i>
        }
    </ul>
}